Preserve white space in text plugin.#6833
Conversation
| margin-bottom: 0.3em; | ||
| } | ||
| #markdown p { | ||
| white-space: pre; |
There was a problem hiding this comment.
This will have the unintended consequence of meaning that actual paragraphs of text will not be wrapped in a sane manner.
For the use case you are investigating, I think we should understand why the markdown renderer is wrapping some text with <pre><code></code></pre> and other code with just <p>.
I suspect it has to do with the non alpha-numeric text included in the results but that is just speculation.
Markdown Rendering is here:
https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugin_util.py
There was a problem hiding this comment.
Thanks Brian, that's a good point. I'll look into that thing from the markdown converter until, but also, how about using white-space: break-spaces; instead? Looks like this pretty much solves the problem by allowing text to wrap, but preserving spaces: https://developer.mozilla.org/en-US/docs/Web/CSS/white-space
There was a problem hiding this comment.
That result with the <pre> tags seems to come from the markdown library. I don't think it's worth trying to figure out how that works. I'm more inclined to just go with the white-space: break-spaces; solution. If users have an issue with this, we can add a checkbox control later, similar to the "markdown" one, tho I imagine most users would want to see the spaces if they're there.
| margin-bottom: 0.3em; | ||
| } | ||
| #markdown p { | ||
| white-space: break-spaces; |
There was a problem hiding this comment.
Mind adding a comment or just a link to the bug (imo its ok that the bug is internal only)?
Some users require the spaces to be preserved in the text shown in the text dashboard. At the moment I can't think of a reason why not to enable this unconditionally. I imagine anybody interested in seeing text logged would be interested in the value *verbatim*, including spaces. Googlers, see b/335770352
Some users require the spaces to be preserved in the text shown in the text dashboard.
At the moment I can't think of a reason why not to enable this unconditionally. I imagine anybody interested in seeing text logged would be interested in the value verbatim, including spaces.
Googlers, see b/335770352